package com.gewu.pm.ui.adapter.order;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.gewu.pm.R;
import com.gewu.pm.app.AppAdapter;
import com.gewu.pm.bean.ApprovalFlowBean;

/**
 * 审批流程适配器
 */
public final class ApprovalFlowAdapter extends AppAdapter<ApprovalFlowBean> {

    public ApprovalFlowAdapter(Context context) {
        super(context);
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder();
    }

    private final class ViewHolder extends AppAdapter<?>.ViewHolder {

        private final TextView tvTime;
        private final TextView tvContent;

        private ViewHolder() {
            super(R.layout.payment_receipt_approval_item);
            tvTime = findViewById(R.id.tv_time);
            tvContent = findViewById(R.id.tv_content);
        }

        @Override
        public void onBindView(int position) {
            ApprovalFlowBean bean = getItem(position);
            tvTime.setText(bean.getTime());
            tvContent.setText(bean.getContent());
        }
    }
}

